// import Vue from 'vue'

import { App } from 'vue'
import checkPermission from '@/utils/permission'

function setupPermissionDirective (app: App) {
  app.directive('permission', (el:HTMLElement, binding:any) => {
    if (!checkPermission(binding.value)) {
      el.style.display = 'none'
    }
  })
}

export function setupGlobDirectives (app: App) {
  setupPermissionDirective(app)
}
